﻿using System;
using System.Text;
using System.Collections;
using System.Collections.Generic;

namespace SedionFormDesigner.Serializer.BasicStruct
{
    public class XmlFromModelList : IEnumerable
    {
        private List<XmlFormModel> modelList;
        public XmlFromModelList()
        {
            modelList = new List<XmlFormModel>();
        }

        public void Add(XmlFormModel formModel)
        {
            modelList.Add(formModel);
        }

        public override string ToString()
        {
            StringBuilder builder = new StringBuilder();
            foreach (XmlFormModel item in modelList)
            {
                builder.Append(item.ToString());
            }
            return builder.ToString();
        }
        public XmlFormModel this[Int32 index]
        {
            get { return modelList[index]; }
        }
        public Int32 GetCount()
        {
            return modelList.Count;
        }

        #region IEnumerable 成员

        public IEnumerator GetEnumerator()
        {
            return modelList.GetEnumerator();
        }

        #endregion
    }
}
